﻿package  {
import com.urbansquall.display.Tile9;
import com.urbansquall.display.Tile9Data;
import flash.display.DisplayObject;
import flash.display.Sprite;
import flash.geom.Rectangle;
public class Main extends Sprite
{	
	[Embed(source='btn_tile9.png')]	
	private static const ButtonNormalSWF : Class;
	
	public function Main()
	{
		var buttonNormal : DisplayObject = new ButtonNormalSWF();
		var scale9Rect : Rectangle = new Rectangle( 6, 8, 12, 8 );
		var buttonNormalScale9Data : Tile9Data = new Tile9Data( buttonNormal, scale9Rect );
		
		for( var i : int = 0; i < 30; i++ )
		{
			var tile9 : Tile9 = new Tile9( buttonNormalScale9Data );
			tile9.x = Math.floor( Math.random() * ( this.stage.stageWidth ) );
			tile9.y = Math.floor( Math.random() * ( this.stage.stageHeight ) );
			tile9.width = Math.floor( 40 + Math.random() * ( this.stage.stageWidth - tile9.x ) );
			tile9.height = Math.floor( 40 + Math.random() * ( this.stage.stageHeight - tile9.y ) );
			addChild( tile9 );
		}
	}
	
} // c
} // p